package com.zhuzi.dto.weixin.text;

import cn.hutool.core.util.StrUtil;
import com.google.common.collect.Lists;
import com.zhuzi.common.utils.LocalDateTimeUtils;
import com.zhuzi.common.utils.StringUtil;
import com.zhuzi.dto.weixin.WxContent;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhuzi
 * 2023/7/8 15:38
 * 申购
 */
@Data
@Accessors(chain = true)
public class OrderSrtyle extends WxContent {

    /**
     * 申购或者上市列表
     */
    private List<String> strList;

    @Override
    public String content() {
        String title = StringUtil.centerEmoji("申购提醒啊", 20, "\uD83D\uDC49", "\uD83D\uDC48");
        ArrayList<String> strings = Lists.newArrayList(title);
        if (CollectionUtils.isNotEmpty(strList)) {
            strings.addAll(strList);
        }
        strings.add(StringUtil.center(LocalDateTimeUtils.formatNormal(), 20));

        return String.join(StrUtil.LF, strings);
    }
}
